package br.com.foxinline.servico;

import br.com.foxinline.modelo.Doenca;
import java.util.List;
import javax.ejb.Stateless;

/**
 *
 * @author laverson
 */
@Stateless
public class DoencaServico extends ServicoGenerico<Doenca> {

    public DoencaServico() {
        super(Doenca.class);
    }

    public List<Doenca> autoComplete(String query) {
        List<Doenca> results = getEntityManager().createQuery("select d from " + Doenca.class.getSimpleName() + " d where lower(e.nome) like '%" + query.toLowerCase().trim() + "%'").getResultList();
        return results;
    }
}
